package com.ruoyi.business.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.business.domain.Employee;
import com.ruoyi.business.domain.HisGuest;
import com.ruoyi.business.domain.model.AccommodationStats;
import com.ruoyi.business.domain.model.EmployeeClassification;
import com.ruoyi.business.domain.vo.EmployeeVo;
import com.ruoyi.business.mapper.BedsPlusMapper;
import com.ruoyi.business.mapper.EmployeeMapper;
import com.ruoyi.business.mapper.EmployeePlusMapper;
import com.ruoyi.business.service.IEmployeePlusService;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeePlusServiceImpl extends ServiceImpl<EmployeePlusMapper, Employee> implements IEmployeePlusService {
    @Autowired
    private EmployeePlusMapper employeePlusMapper;
    @Autowired
    private EmployeeMapper employeeMapper;

    @Override
    public LambdaQueryWrapper<Employee> buildQueryWrapper(Employee bo) {
        LambdaQueryWrapper<Employee> lqw = Wrappers.lambdaQuery();
        lqw.eq(StringUtils.isNotBlank(bo.getJobNumber()), Employee::getJobNumber, bo.getJobNumber());
        lqw.like(StringUtils.isNotBlank(bo.getFullName()), Employee::getFullName, bo.getFullName());
        lqw.eq(StringUtils.isNotBlank(bo.getDepartment()), Employee::getDepartment, bo.getDepartment());
        lqw.eq(StringUtils.isNotBlank(bo.getOutsource()), Employee::getOutsource, bo.getOutsource());

        lqw.eq(StringUtils.isNotBlank(bo.getDelFlag()), Employee::getDelFlag, bo.getDelFlag());
        return lqw;
    }

    @Override
    public List<EmployeeClassification> getEmployeeClassification() {
        return employeePlusMapper.getEmployeeClassification();
    }

    @Override
    public AccommodationStats getAccommodationStats() {
        return employeePlusMapper.getAccommodationStats();
    }
    @Override
    public void updateAge() {
        employeePlusMapper.updateAge();
    }
    @Override
    public List<Employee> ContractExpirationReminder(Employee query) {
        return employeePlusMapper.ContractExpirationReminder(query);
    }

    @Override
    public List<Employee> retirementReminder(Employee query) {
        return employeePlusMapper.retirementReminder(query);
    }

    @Override
    public List<EmployeeVo> ContractExpirationReminderVo(EmployeeVo query) {
        return employeeMapper.ContractExpirationReminder(query);
    }

    @Override
    public List<EmployeeVo> retirementReminderVO(EmployeeVo query) {
        return employeeMapper.retirementReminder(query);
    }
}
